package lambda.jdkfunctioninterface.供给型;

import java.util.function.Supplier;
import org.testng.annotations.Test;

/**
 *
 */
public class Supplier1 {

    public static void main(String[] args) {
        test1();
        test2();

    }

    public static void test1() {
        Supplier supplier = () -> 1;
        System.out.println(supplier.get());

    }

    @Test
    public static void test2() {
        Supplier<String> supplier = () -> "ok";
        Supplier<Integer> supplier2 = () -> 2;
        System.out.println(supplier.get());
        System.out.println(supplier2.get());
    }

}
